package com.xidian.zhiancloud.service.user;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.xidian.zhiancloud.dao.syset.BpmcMapper;
import com.xidian.zhiancloud.dao.syset.BpmlMapper;
import com.xidian.zhiancloud.model.syset.BpmcList;
import com.xidian.zhiancloud.model.syset.BpmlList;
import com.xidian.zhiancloud.qo.BaseReqQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.Page;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class BpmcService extends ServiceImpl<BpmcMapper, BpmcList> {

    @Autowired
    BpmcMapper bpmcMapper;

    @Autowired
    BpmlMapper bpmlMapper;

    public List<BpmcList> getBpmcList(Long companyId){

        return bpmcMapper.getBpmcList(companyId);
    }

    public Page<BpmlList> getBpmlList
            (Long companyId,Integer bpmid, BaseReqQuery reqdata){
        PageHelper.startPage(reqdata.getPageNum(), reqdata.getPageSize());
        Page<BpmlList> pagedata = bpmlMapper.getBpmlList(companyId,bpmid);
        return pagedata;
    }

    public int addBpml(Long id,BpmlList bpml){

        return bpmlMapper.addBpml(id,bpml);
    }

    public int detleBpml(String id){
        return bpmlMapper.detleBpml(id);
    }

    public List<BpmlList> selectByIds(Long companyId,String id){

        return bpmlMapper.selectByIds(companyId,id);
    }

     public int updateByIdAndStatus(String id,String status){
         return bpmlMapper.updateByIdAndStatus(id,status);
     }

}
